<div class="panelBar">
	<ul class="toolBar">
		<li><a class="add" href="javascript:;" url="entity/select.html?category_id=0&entity={entity}&entity_id={entity_id}" target="dialog" rel="selectEntity" mask="true" callback="relation" title="选择关联内容" width="700" height="500"><span>增加关联内容</span></a></li>
		<li><a class="delete" url="/{entity}/{entity_id}/relation/{entity_relation_id}" area="tbody.list" callback="$this.parents('.panelBar').next().find('>table.list').removeAttr('loaded').jBinds()" type="delete" target="navTabTodo" title="确定要删除选中的数据吗？" warn="请选择需要删除的数据项！"><span>删除</span></a></li>
	</ul>
</div>
<div class="tableList">
	<table class="list" width="100%">
		<thead>
			<tr>
				<th width="25"><input type="checkbox" name="objectId" value="entity_relation_id"/></th>
				<th width="30">编号</th>
				<th width="30">id</th>
				<th width="35">图片</th>
				<th>名称</th>
				<th>描述</th>
				<th width="125">日期</th>
			</tr>
		</thead>
		<tbody class="templet">
			<tr entity_relation_id="${entity_id}">
				<td><input type="checkbox" name="entity_relation_id" value="${entity_relation_id}" /></td>
				<td>${num}</td>
				<td>${entity_relation_id}</td>
				<td>
					<img name="picture" src="images/jpg.gif" onerror="this.src='images/jpg.gif'" path="${image.small}" midpath="${image.middle}" oldpath="${image.origin}" height="21px" title="${image.name}"/>
				</td>
				<td title="${title}">${title}</td>
				<td title="${content}">${content}</td>
				<td title="${create_date}">${create_date}</td>
			</tr>
		</tbody>
		<tbody class="list" action="{entity}/{entity_id}/relation">
		</tbody>
	</table>
</div>
<script>
function relation(data,jDom){
	if(!data||data.length==0) return;
	var tb = jDom.parents('.panelBar').next().find('>table.list');
	var url = $("tbody.list",tb).attr("action");
	url+="/"+data.join("_");
	DWZ.post(url,function(){
		tb.removeAttr('loaded').jBinds();
	})
}
</script>